package repository.relsys.services.datacentral;

import org.apache.log4j.Logger;

import repository.relsys.config.*;


public class DataProviderFactory
{


	private static Logger logger = Logger.getLogger(DataProviderFactory.class
			.getName());


	public static DataProvider getDataProvider(String source) 
	{
		if (Constants.DATABASE_STORE.equals(source))
			return new RepositoryDataProvider();
		if (Constants.FILE_STORE.equals(source))
			return new FileDataProvider();

		logger.error("The provided argument " + source + " is invalid!");
		throw new IllegalArgumentException("The provided argument " + source
				+ " is invalid!");
	}

}
